#pragma once
#include "SQLHeader.h"
#include "TableInfo.h"
#include <map>

class RowStructure
{
private:
	char tagA;
	short tagB;
	short fSize;
	short nCol;
	short varCount;
	char * rowData;
	char * fData;
	char * nullBits;
	short * varOffset;
	char * varData;
	int recordLen;
	std::map<std::string,std::string> columns;
	std::string tableName;
	TABLE_INFO * tableInfo;
public:
	RowStructure(void);
	RowStructure(std::string name);
	void ConstructData(const QueryInfo & q);
	void ConstructData(std::map<std::string, std::string> & recordInfo);
	void FillInRow(char * buf);
	int GetRecordLen() { return recordLen; }
	void ParseColumns(char * row, std::string tablename);
	std::map<std::string,std::string> & GetColumns() { return columns; }
	void ReleaseResource();
	~RowStructure(void);
};
